package entity;

import java.io.Serializable;
import java.util.ArrayList;
import java.util.Collection;
import javax.persistence.*;

/**
 *
 * @author James
 */
@Entity
@NamedQueries({
  @NamedQuery(name="vFolder.findAllFolders",
              query="SELECT e FROM vFolder e where e.folder = :FOLDER"),
  @NamedQuery(name="vFolder.getRoot",
              query="SELECT e FROM vFolder e where e.fdname = 'root'")
})

public class vFolder implements Serializable {

    private String fdname;
    private int fdowner;

    public vFolder()
    {
    }


    private vFolder folder;

    @JoinColumn
    @ManyToOne
    public vFolder getFolder() {
        return folder;
    }

    public void setFolder(vFolder folder) {
        this.folder = folder;
    }

    private static final long serialVersionUID = 1L;
    private Long id;

    @Id
    @GeneratedValue(strategy = GenerationType.AUTO)
    public Long getId() {
        return id;
    }




    public vFolder(String fdname,int fdowner)
    {
        this.fdname = fdname;
        this.fdowner = fdowner;

    }

    @Column(length = 50)
    public String getFdname() {
        return fdname;
    }

    @Column
    public int getFowner() {
        return fdowner;
    }


    public void setFdname(String fdname)
    {
        this.fdname = fdname;
    }

    public void setFowner(int fdowner)
    {
        this.fdowner = fdowner;
    }

     public void setId(Long id) {
        this.id = id;
    }

    @Override
    public int hashCode() {
        int hash = 0;
        hash += (id != null ? id.hashCode() : 0);
        return hash;
    }

    @Override
    public boolean equals(Object object) {
        // TODO: Warning - this method won't work in the case the id fields are not set
        if (!(object instanceof vFolder)) {
            return false;
        }
        vFolder other = (vFolder) object;
        if ((this.id == null && other.id != null) || (this.id != null && !this.id.equals(other.id))) {
            return false;
        }
        return true;
    }

    @Override
    public String toString() {
        return "entity.Folderr[id=" + id + "]";
    }

}





